#!/bin/bash
SQL_DIR="./setup"
MYSQL_HOST=localhost
MYSQL_PORT=3306

for f in `find $SQL_DIR -name "*.sql"`
do
  echo "import $f..."
  mysql -h$MYSQL_HOST -P$MYSQL_PORT -u$MYSQL_USER -p$MYSQL_PASSWORD -f $MYSQL_DATABASE -e "source $f"
  mv $f $f.done
done
echo 'Setup successfully!'